Choice of antibiotics in the diabetic foot.

Using R to Analyse and Predict Antimicrobial Resistance Rates for Isolates from Blood Cultures collected at NUTH from Q1 2019 onwards.

Daniel Weiand (Consultant Medical Microbiologist)

Newcastle upon Tyne Hospitals NHS Foundation Trust

Thursday, 6 July, 2023

Session aims

  1. Introduce R

  2. Run through a working example of a project completed using R, exploring AMR rates in patients with diabetes

  3. Summarise learning points with regards to choice of antibiotics in the diabetic foot

What is R?

  • R is one of the most commonly used languages for data science, together with Python.

  • R is a powerful, free open source data science and statistics environment, used in industry, academia and major corporations (eg Microsoft, Google, Facebook).

  • R benefits from a worldwide community that freely shares learning and resources, through e.g. GitHub

Why use R for data science?

  • The Goldacre report actively promotes the use of R in the NHS.

  • Mountains of data are transforming our world and have the potential to help us make better decisions.

  • To influence our decision-making, this data must be shaped, checked, curated, analysed, interpreted, and appropriately communicated.

  • This process requires people with modern data skills, working in teams, using platforms like R to do the heavy lifting.

  • NUTH now actively supports the use of R at scale, and it can be installed on any work PC.

Many of you are already familiar with R

NHS-R

  • The Health Foundation supports NHS-R, which delivers free-to-NHS-staff online training, and runs the premier data science conference in the NHS.

  • It’s free to register.

  • NHS-R supports a thriving Slack community, and is active on twitter #Rstats #TidyTuesday

So now for a working example

  • Aim: Using R to Analyse and Predict Antimicrobial Resistance Rates for Blood Culture Isolates in Diabetic Patients, to influence the choice of antibiotics in the diabetic foot.

  • Objectives:

    • Import blood culture data into R

    • Import diabetes data into R

    • Wrangle, combine, visualise, and explore the data

    • Stratify the data by diabetic- and diabetic foot status

Methods

  • The laboratory information management system (LIMS) was interrogated to collect data on all culture-positive blood cultures collected between 2019-04-01 and 2023-03-31

  • ICD-10 coding data was analysed to determine diabetic- and diabetic foot status of all patients with culture-positive blood cultures

The AMR package for R

  • The AMR package [1,2] provides a standard for clean and reproducible analysis and prediction of Antimicrobial Resistance (AMR), and was used to:

    • determine ‘first isolates’ for use in the final analysis, as per Hindler et al [3];

    • calculate and visualise AMR data;

    • predict future AMR rates using regression models.

Totals (blood culture data)

  • In total, 11098 distinct positive blood cultures were collected from 6888 distinct patients, leading to isolation of 12272 organisms.

  • Taking into consideration ‘first isolates’ only, 8780 distinct positive blood cultures were collected from 6888 distinct patients, leading to isolation of 9648 organisms.

  • From this point onwards, this analysis concentrates only on ‘first isolates’ from blood cultures, to intelligently de-duplicate the data

Totals (diabetic data)

Since Q1 2019:

  • 29104 distinct patients with diabetes

  • 607 distinct patients with diabetic feet

  • 70533 encounters

  • 15813 patients had only a single encounter

Duration of encounters for patients with diabetes

  • The mean inpatient stay duration for patients with diabetes was 3.39 days

Inpatient stay duration for patients with diabetic feet

  • The mean inpatient stay duration for patients with diabetic feet was 14.95 days

Location of blood culture collection

Time series data

TRUE = diabetic foot, FALSE = diabetic without diabetic foot

Organisms isolated from blood cultures

a = all blood cultures, b = patients with diabetes, c = patients with diabetic feet

E. coli and Klebsiella AMR rates

Pseudomonas spp. AMR rates

S. aureus AMR rates

Predicted AMR rates for Gram-negative organisms

Predicted AMR rates for Gram-positive organisms

Summary

  • R is an excellent platform for data science, including analysis and prediction of AMR rates

  • Patients with diabetes account for many bloodstream infections, particularly in the ED, assessment suite, and dialysis unit

  • Mean inpatient encounter duration is particularly prolonged for patients with diabetic foot infections

  • S. aureus and Proteus spp appear to cause more-than-expected morbidity in patients with diabetic feet

  • Resistance rates are rising, particularly to co-amoxiclav and tazocin

  • For Gram-positive infections, flucloxacillin remains an excellent choice

Thanks for listening

Daniel Weiand, Consultant medical microbiologist

Newcastle upon Tyne Hospitals NHS Foundation Trust

Email: dweiand@nhs.net

Twitter: @send2dan

NHS-R community blog: https://nhsrcommunity.com/author/daniel-weiand/

GitHub: send2dan

References

1
Berends MS, Luz CF, Friedrich AW, et al. AMR: An R package for working with antimicrobial resistance data. Journal of Statistical Software 2022;104:1–31. doi:10.18637/jss.v104.i03
2
Berends MS, Luz CF, Souverein D, et al. AMR: Antimicrobial resistance data analysis. 2023. https://CRAN.R-project.org/package=AMR
3
Hindler JF, Stelling J. Analysis and presentation of cumulative antibiograms: A new consensus guideline from the Clinical and Laboratory Standards Institute. Clinical infectious diseases 2007;44:867–73.